<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.7.2.min.js"></script>
<title>游客联系客服列表</title>
<style type="text/css">
#list{font-size:50px; color: Blue;}
</style>
<script type="text/javascript">
	$(function(){
		var _vsocket = null;
	    _vsocket = new WebSocket('ws://linyuqun.oicp.net:8080/webchat/chatserver');   
	    _vsocket.onopen = function(event) 
	    {
	        var registObj = {
	                "action" : "reqServiceList",
	                "companyId":""
	                };
	        _vsocket.send(JSON.stringify(registObj));        
	    };    
	    _vsocket.onmessage = function(event) 
	    {
	        var e =  eval('(' + event.data + ')');  
	        if(e.action == 'servicelist')
	        {
	            $.each(e.servicelist, function(key,value){ 	 	
	                var _li = $('<li/>').text(value);
	                _li.attr("id", value);	               
	                $('#kflist').append(_li);
	                $("#kflist li").mouseover(function() {
	                    $(this).addClass("hover").siblings().removeClass("hover");
	                }).mouseout(function() {
	                    $(this).removeClass("hover").siblings().removeClass("hover");
	                });	                
	                _li.click(function(){
	                    location.href= "server.html?to=" + $(this).attr('id');
	                });          
	            });
	        } 
	    }; 	    
	    _vsocket.onclose = function(event) 
	    {
	        //_fAddText("连接断开！");
	    };
	});
</script>

</head>
<body>
<div id="list">在线客服
	<ul id="kflist">
	</ul>
</div>
</body>
</html>